package cn.rkylin.oms.common.jobs;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import cn.rkylin.oms.system.shop.domain.Shop;

/**
 * 抽象作业
 * @author wangxiaoyi
 *
 */
@Component
public abstract class AbstractJob {
	// 调度服务器的url地址，见app.properties
	@Value("${create.shop.jobs}")
	protected String createShopJobs;
	
	// 调度服务器的url地址，见app.properties
	@Value("${scheduler.addJob.url}")
	protected String addJobURL;
	
	// post数据
	protected Map<String, String> postDatas = new HashMap<String, String>();
	// parameterNames和parameterValues，需要有序对应
	protected List<String> repeatNames = new ArrayList<String>();
	protected List<String> repeatValues = new ArrayList<String>();

	/**
	 * 创建job
	 * @param shop
	 * @throws Exception
	 */
	public abstract <T> void createJob(T entity) throws Exception;
}
